|Tools| <Sample widget interfaces| |Up to Yassl: Scripting language | |Check out the interpreter>

Yassl: Scripting language Embedding applets as widgets


5.4 Embedding applets as widgets

To demonstrate this idea, I've written a widget that can "embed" an applet directly. On this page, I've taken two unmodified applets from the sun demo. Whats different about them is that they are now embedded within the one big applet, and are controlled with buttons. Applets can be controlled to the extent a generic applet allows itself to be manipulated, you can initialize, start and stop them.

A status label appearing below each embedded widget displays any status messages from the applet. Parameters to the applet can be specified as a list of strings to the yassl call that loads the embedded applet. Pressing the start button calls the init() and start() methods on the embedded applet. Pressing it again calls the stop() and destroy() methods in the applet.

The embedded applet widget still has some bugs, mostly in the resizing capability.

Here is the source for the script that creates applets-as-widgets.


|Tools| <Sample widget interfaces| |Up to Yassl: Scripting language | |Check out the interpreter>

KB Sriram
Comments, bug reports: kbs@sbktech.org

Revised: Sat May 25 02:58:13 1996
URL: http://www.sbktech.org/yas_emb.html